package com.fengye.hbase.example;

import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Test {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        int i = 0;
        String key = "";
        StringTokenizer tokenizer = new StringTokenizer("{\"p_id\":\"100030\",\"p_name\":\"<张家界-凤凰-天门山-玻璃栈道5日游>\",\"price\":\"2141\"}", "({}\":,)");
        while (tokenizer.hasMoreTokens()) {
            if (++i % 2 == 0) {
                map.put(key, tokenizer.nextToken());
            } else {
                key = tokenizer.nextToken();
            }
        }
    }
}
